﻿@model IEnumerable<e_commerce.Foreground.Models.Goods>
@{
    ViewBag.Title = "商城首页";
    Layout = "~/Views/Shared/_ShopMallLayout.cshtml";
}

<div class="slider-img" id="slider-div">
    <ul>
        <li id="slider1">
            <img src="~/Image/CnQOjVhjOAWAKNkJAAIZ3yMO194082.png" />
        </li>
        <li id="slider2">
            <img src="~/Image/CnQOjVidK0KALcCtAAf_Y1wbrkE270.jpg" />
        </li>
        <li id="slider3">
            <img src="~/Image/CnQOjViVm5mAMGsjAAJ2Yt8ThG8451.jpg" />
        </li>
    </ul>
</div>

<div class="goods-wrap">
    <div class="goods-title">
        <span>手机</span>
        <a href="/Page/List?category=1">更多>></a>
    </div>
    <div class="goods-show">
        @foreach (var item in Model)
        {
            if (item.Category == 1)
            {
                if (item.IsFirst)
                {
                    <div class="first-goods" style="background-image:url(@item.Images)">
                        <a href="/Page/Detail?goodsId=@item.GoodsId">
                        </a>
                        <div class="goods-buy-wrap">
                            <a href="/Page/Detail?goodsId=@item.GoodsId">立即购买</a>
                        </div>
                    </div>
                }
                else
                {
                    <a href="/Page/Detail?goodsId=@item.GoodsId">
                        <div class="goods-card">
                            <img class="goods-img" src="@item.Images" style="width:180px;height:180px;" />
                            <div class="goods-message">
                                <span class="goods-item-name">@item.GoodsName</span>
                                <span class="goods-tip">@item.Details</span>
                                <span class="goods-price">￥@item.Price</span>
                            </div>
                        </div>
                    </a>
                }
            }
        }
            
    </div>
</div>

<div class="goods-wrap">
    <div class="goods-title">
        <span>其他配件</span>
        <a href="/Page/List?category=2">更多>></a>
    </div>
    <div class="goods-show">
        @foreach (var item in Model)
        {
            if (item.Category == 2)
            {
                if (item.IsFirst)
                {
                    <div class="first-goods" style="background-image:url('@item.Images')">
                        <a href="/Page/Detail?goodsId=@item.GoodsId">
                        </a>
                        <div class="goods-buy-wrap">
                            <a href="/Page/Detail?goodsId=@item.GoodsId">立即购买</a>
                        </div>
                    </div>
                }
                else
                {
                    <a href="/Page/Detail?goodsId=@item.GoodsId">
                        <div class="goods-card">
                            <img class="goods-img" src="@item.Images" style="width:180px;height:180px;" />
                            <div class="goods-message">
                                <span class="goods-item-name">@item.GoodsName</span>
                                <span class="goods-tip">@item.Details</span>
                                <span class="goods-price">￥@item.Price</span>
                            </div>
                        </div>
                    </a>
                }
            }
        }

    </div>
</div>

@section Styles{
    <link href="~/CSS/home.css" rel="stylesheet" />
}
